import api from '../api.js'
export function getTenderList(pageIndex, pageSize, domain = '[]', filter = {
	search: '',
	search_fields: '',
	order: 'id desc'
}) {
	return api.readPage('jhj.bidding.process', 'id,state,bidding_name', pageIndex, pageSize, domain, filter)
}
// export function getTenderDetail(id) {
// 	return api.read('jhj.bidding.process', id,
// 		'id,order_id,state,user_id,bidding_name,tender_end_date,regist_end_date,project_name,project_code,reviewer_date')
// }

export function getTenderDetail(id) {
	return api.postFunction('jhj.bidding.process', '_api_one', {
		process_id: id
	})
}
export function deleteFile(checksum, user_id) {
	return api.postFunction('ir.attachment', '_api_unlink_checksum', {
		checksum,
		user_id
	})
}
export function changeState(id, state) {
	return api.write('jhj.bidding.process', {
		["form-field-char-state"]: state
	}, id)
}
